/**
 * Selling Partner API for Listings Items
 * The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API.  For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide).
 *
 * The version of the OpenAPI document: 2021-08-01
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */

import { ApiClient } from '../ApiClient.js'

/**
 * The ItemImage model module.
 * @module listingsitems_v2021_08_01/model/ItemImage
 * @version 2021-08-01
 */
export class ItemImage {
  /**
   * Constructs a new <code>ItemImage</code>.
   * The image for the listings item.
   * @alias module:listingsitems_v2021_08_01/model/ItemImage
   * @class
   * @param link {String} The link, or URL, to the image.
   * @param height {Number} The height of the image in pixels.
   * @param width {Number} The width of the image in pixels.
   */
  constructor (link, height, width) {
    this.link = link
    this.height = height
    this.width = width
  }

  /**
   * Constructs a <code>ItemImage</code> from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {ItemImage} obj Optional instance to populate.
   * @return {ItemImage} The populated <code>ItemImage</code> instance.
   */
  static constructFromObject (data, obj) {
    if (data) {
      switch (typeof data) {
        case 'string':
          obj = String(data)
          break
        case 'number':
          obj = Number(data)
          break
        case 'boolean':
          obj = Boolean(data)
          break
      }
      obj = obj || new ItemImage()
      if (data.hasOwnProperty('link')) { obj.link = ApiClient.convertToType(data.link, 'String') }
      if (data.hasOwnProperty('height')) { obj.height = ApiClient.convertToType(data.height, 'Number') }
      if (data.hasOwnProperty('width')) { obj.width = ApiClient.convertToType(data.width, 'Number') }
    }
    return obj
  }
}

/**
 * The link, or URL, to the image.
 * @member {String} link
 * @type {String}
 */
ItemImage.prototype.link = undefined

/**
 * The height of the image in pixels.
 * @member {Number} height
 * @type {Number}
 */
ItemImage.prototype.height = undefined

/**
 * The width of the image in pixels.
 * @member {Number} width
 * @type {Number}
 */
ItemImage.prototype.width = undefined
